Out[164]:
ThemeRegistry.enable('latimes')

Fetch datasets

Out[4]:
country_name alpha-2_code alpha-3_code numeric_code iso_3166-2
0 Afghanistan AF AFG 4 ISO 3166-2:AF
1 Ã…land Islands AX ALA 248 ISO 3166-2:AX
2 Albania AL ALB 8 ISO 3166-2:AL
3 Algeria DZ DZA 12 ISO 3166-2:DZ
4 American Samoa AS ASM 16 ISO 3166-2:AS
... ... ... ... ... ...
241 Wallis and Futuna WF WLF 876 ISO 3166-2:WF
242 Western Sahara EH ESH 732 ISO 3166-2:EH
243 Yemen YE YEM 887 ISO 3166-2:YE
244 Zambia ZM ZMB 894 ISO 3166-2:ZM
245 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW

246 rows × 5 columns

Out[5]:
iso_code location date total_cases new_cases total_deaths new_deaths total_cases_per_million new_cases_per_million total_deaths_per_million new_deaths_per_million total_tests new_tests total_tests_per_thousand new_tests_per_thousand tests_units
0 ABW Aruba 2020-03-13 2 2 0 0 18.733 18.733 0.0 0.0 NaN NaN NaN NaN NaN
1 ABW Aruba 2020-03-20 4 2 0 0 37.465 18.733 0.0 0.0 NaN NaN NaN NaN NaN
2 ABW Aruba 2020-03-24 12 8 0 0 112.395 74.930 0.0 0.0 NaN NaN NaN NaN NaN
3 ABW Aruba 2020-03-25 17 5 0 0 159.227 46.831 0.0 0.0 NaN NaN NaN NaN NaN
4 ABW Aruba 2020-03-26 19 2 0 0 177.959 18.733 0.0 0.0 NaN NaN NaN NaN NaN
Out[6]:
(331002836.90142155, 65272613.4815742, 83785216.29224937)
Out[7]:
geo_type region transportation_type date change location iso_code
0 country/region Albania driving 2020-01-13 0.0000 Albania ALB
1 country/region Albania driving 2020-01-14 -0.0470 Albania ALB
2 country/region Albania driving 2020-01-15 0.0143 Albania ALB
3 country/region Albania driving 2020-01-16 -0.0280 Albania ALB
4 country/region Albania driving 2020-01-17 0.0355 Albania ALB
... ... ... ... ... ... ... ...
39890 city Zurich walking 2020-04-18 -0.2394 NaN NaN
39891 city Zurich walking 2020-04-19 -0.2578 NaN NaN
39892 city Zurich walking 2020-04-20 -0.3494 NaN NaN
39893 city Zurich walking 2020-04-21 -0.3382 NaN NaN
39894 city Zurich walking 2020-04-22 -0.2765 NaN NaN

39895 rows × 7 columns

C:\Users\Horace\miniconda3\envs\uncover\lib\site-packages\IPython\core\interactiveshell.py:3063: DtypeWarning: Columns (3) have mixed types.Specify dtype option on import or set low_memory=False.
  interactivity=interactivity, compiler=compiler, result=result)
Out[8]:
country_region_code country_region sub_region_1 sub_region_2 date retail_and_recreation grocery_and_pharmacy parks transit_stations workplaces residential country_name alpha-2_code alpha-3_code numeric_code iso_3166-2 location iso_code
0 AE United Arab Emirates NaN NaN 2020-02-15 0.0 4.0 5.0 0.0 2.0 1.0 United Arab Emirates AE ARE 784 ISO 3166-2:AE United Arab Emirates ARE
1 AE United Arab Emirates NaN NaN 2020-02-16 1.0 4.0 4.0 1.0 2.0 1.0 United Arab Emirates AE ARE 784 ISO 3166-2:AE United Arab Emirates ARE
2 AE United Arab Emirates NaN NaN 2020-02-17 -1.0 1.0 5.0 1.0 2.0 1.0 United Arab Emirates AE ARE 784 ISO 3166-2:AE United Arab Emirates ARE
3 AE United Arab Emirates NaN NaN 2020-02-18 -2.0 1.0 5.0 0.0 2.0 1.0 United Arab Emirates AE ARE 784 ISO 3166-2:AE United Arab Emirates ARE
4 AE United Arab Emirates NaN NaN 2020-02-19 -2.0 0.0 4.0 -1.0 2.0 1.0 United Arab Emirates AE ARE 784 ISO 3166-2:AE United Arab Emirates ARE
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
230823 ZW Zimbabwe NaN NaN 2020-04-13 -71.0 -63.0 -51.0 -83.0 -80.0 49.0 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW Zimbabwe ZWE
230824 ZW Zimbabwe NaN NaN 2020-04-14 -63.0 -53.0 -47.0 -78.0 -64.0 41.0 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW Zimbabwe ZWE
230825 ZW Zimbabwe NaN NaN 2020-04-15 -62.0 -50.0 -51.0 -77.0 -65.0 42.0 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW Zimbabwe ZWE
230826 ZW Zimbabwe NaN NaN 2020-04-16 -62.0 -50.0 -48.0 -77.0 -64.0 42.0 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW Zimbabwe ZWE
230827 ZW Zimbabwe NaN NaN 2020-04-17 -62.0 -48.0 -47.0 -79.0 -62.0 43.0 Zimbabwe ZW ZWE 716 ISO 3166-2:ZW Zimbabwe ZWE

230828 rows × 18 columns

Out[9]:
country_region_code  country_region        sub_region_1  sub_region_2  country_name          alpha-2_code  alpha-3_code  iso_3166-2     location              iso_code  numeric_code  date        mobility_category    
AE                   United Arab Emirates  NaN           NaN           United Arab Emirates  AE            ARE           ISO 3166-2:AE  United Arab Emirates  ARE       784           2020-02-15  retail_and_recreation    0.00
                                                                                                                                                                                                  grocery_and_pharmacy     0.04
                                                                                                                                                                                                  parks                    0.05
                                                                                                                                                                                                  transit_stations         0.00
                                                                                                                                                                                                  workplaces               0.02
                                                                                                                                                                                                                           ... 
ZW                   Zimbabwe              NaN           NaN           Zimbabwe              ZW            ZWE           ISO 3166-2:ZW  Zimbabwe              ZWE       716           2020-04-17  grocery_and_pharmacy    -0.48
                                                                                                                                                                                                  parks                   -0.47
                                                                                                                                                                                                  transit_stations        -0.79
                                                                                                                                                                                                  workplaces              -0.62
                                                                                                                                                                                                  residential              0.43
Name: change, Length: 48765, dtype: float64
Out[10]:
id country iso admin_level_name pcode region log_type category measure targeted_pop_group comments non_compliance date_implemented source source_type link entry_date alternative source
0 1 Afghanistan AFG NaN NaN Asia Introduction / extension of measures Public health measures Health screenings in airports and border cross... No NaN NaN 2020-02-12 Ministry of Health Government https://moph.gov.af/en/moph-held-emergency-mee... 2020-03-14 NaN
1 2 Afghanistan AFG Kabul NaN Asia Introduction / extension of measures Public health measures Introduction of isolation and quarantine policies No NaN NaN 2020-02-12 Ministry of Health Government https://moph.gov.af/en/moph-held-emergency-mee... 2020-03-14 NaN
2 3 Afghanistan AFG NaN NaN Asia Introduction / extension of measures Public health measures Awareness campaigns No NaN NaN 2020-02-12 Ministry of Health Government https://moph.gov.af/en/moph-held-emergency-mee... 2020-03-14 NaN
3 4 Afghanistan AFG NaN NaN Asia Introduction / extension of measures Governance and socio-economic measures Emergency administrative structures activated ... No NaN NaN 2020-02-12 Ministry of Health Government https://moph.gov.af/en/moph-held-emergency-mee... 2020-03-14 NaN
4 5 Afghanistan AFG NaN NaN Asia Introduction / extension of measures Social distancing Limit public gatherings No Nevruz festival cancelled NaN 2020-03-12 AA Media https://www.aa.com.tr/en/asia-pacific/coronavi... 2020-03-14 NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
7074 4303 Zimbabwe ZWE NaN NaN Africa Phase-out measure Public health measures Other public health measures enforced No Zimbabwe reversed a ban on the sale of alcohol... Not applicable 2020-04-03 BBC Media https://www.bbc.com/news/topics/crr7mlg0rpvt/z... 2020-04-07 NaN
7075 4646 Zimbabwe ZWE NaN NaN Africa Introduction / extension of measures Governance and socio-economic measures State of emergency declared No Declaration of State of Disaster, 17 March Not applicable 2020-03-17 ONHCR Document UN See ACAPS folder 2020-04-10 NaN
7076 5420 Zimbabwe ZWE NaN NaN Africa Introduction / extension of measures Public health measures Testing policy No Zimbabwe begins mass testing with the aim to e... Not applicable 2020-04-15 BBC Media https://www.bbc.com/news/world/africa/live 2020-04-15 NaN
7077 5421 Zimbabwe ZWE NaN NaN Africa Introduction / extension of measures Governance and socio-economic measures Emergency administrative structures activated ... No The Ministry has launched a tollfree helpline ... Not applicable 2020-04-14 Ministry of Information Social media https://twitter.com/MinOfInfoZW/status/1250037... 2020-04-15 NaN
7078 6425 Zimbabwe ZWE NaN NaN Africa Introduction / extension of measures Lockdown Partial lockdown No Lockdown due to end on the 20th April will be ... Up to detention 2020-04-20 BBC Media https://www.bbc.com/news/live/world-africa-476... 2020-04-20 NaN

7079 rows × 18 columns

Out[11]:
id                                                                    1
country                                                     Afghanistan
iso                                                                 AFG
admin_level_name                                                    NaN
pcode                                                               NaN
region                                                             Asia
log_type                           Introduction / extension of measures
category                                         Public health measures
measure               Health screenings in airports and border cross...
targeted_pop_group                                                   No
comments                                                            NaN
non_compliance                                                      NaN
date_implemented                                    2020-02-12 00:00:00
source                                               Ministry of Health
source_type                                                  Government
link                  https://moph.gov.af/en/moph-held-emergency-mee...
entry_date                                          2020-03-14 00:00:00
alternative source                                                  NaN
Name: 0, dtype: object
Out[12]:
Public health measures                    2436
Movement restrictions                     1649
Governance and socio-economic measures    1394
Social distancing                         1271
Lockdown                                   327
Humanitarian exemption                       2
Name: category, dtype: int64
Out[13]:
<matplotlib.axes._subplots.AxesSubplot at 0x195bdf03b08>
Out[15]:
(9173, 19)

Viz

Measures, new_cases, mobility

Out[166]:

Measures, all mobility categories, new cases

Mobility categories, new_cases

Out[176]:

Merging ECDC, Apple and Google datasets

Correlation: lagged mobility and new cases

What is the timeframe of an effective lockdown ?
Measures which result in a drop in mobility rates have a delayed impact on virus transmission. How long is this period of transition ?

We implement here a simple approach: we lag the mobility time-series by a many number of days, and compute the correlation with the new cases series.

Since the measures are usually implemented amidst the exponential growth phase of the pandemic, we see a high negative correlation for no lag or a few days : this is to be ignored.
What interests us is the positive correlation, which typically happens $\simeq 30$ days afterwards.

SEIR Model

Model

We use an SEIR-HCD model, with typical parameters found in the literature.

We model without interventation at first, then with an arbitrary drop in $R_t$, the effective reproduction number, and finally with a simple dependance of $R_t$ on the mobility rate in the specified country.

Plot model

Without intervention

Intervention (punctual)

R(t) = f(mobility(t))